<template>
  <div class = "school"> 
    <h2>我是School组件</h2>
    <h3>学校名称：{{name}}</h3>
    <h3>学校地址：{{address}}</h3>
    <button @click="handleClick">将我自己的学校名称交给News</button>
  </div>
</template>

<script>
export default {
  name: 'School',
  data() {
    return {
      name: '尚硅谷',
      address: '宏福科技园',
    }
  },
  methods: {
    handleClick() {
      this.$bus.$emit('haha', this.name)
    },
  },
}
</script>
<style scoped>
    .school {
    background-color: orange;
    padding: 20px;
    }
</style>